<template>
	<view class="container">
		<view class="app">
			<view class="cover">
				<u--image :showLoading="true"
					src="https://img.alicdn.com/imgextra/i2/2064565174/O1CN017NDhrR1o5k2GZh7ZI_!!2064565174.png"
					width="360rpx" height="360rpx" mode="aspectFit"></u--image>
			</view>
			<view class="price">
				<view class="number" v-if="!dealer.user_id">0.00</view>
				<view class="number" v-else>{{ dealer.money }}</view>
				<view class="text">账户余额(元)</view>
			</view>
			<view class="submit" v-on:click="onWithdrawal">
				<u-button color="linear-gradient(180deg, #ff8889 0%, #ff6543 100%)" shape="circle" text="立即提现">
				</u-button>
			</view>
			<view class="nav">
				<view class="item">
					<view class="text" v-on:click="onLog">资金明细</view>
				</view>
				<view class="item">
					<view class="text" v-on:click="onCash">提现记录</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		detail
	} from '@/api/user.js';
	import {
		config
	} from '@/api/system.js';
	import {
		dealer
	} from '@/api/dealer.js';
	export default {
		data() {
			return {
				dealer: {},
				store: {},
				userInfo: {}
			};
		},
		onShow() {
			this.getStore()
			this.getDealer();
		},
		methods: {
			getDealer() {
				dealer({}).then(res => {
					this.dealer = res.data.dealer
				}).catch(err => {

				})
			},
			getStore() {
				config({
						key: 'store'
					})
					.then(res => {
						this.store = res.data.config;
					})
					.catch(err => {});
			},
			onCash() {
				uni.navigateTo({
					url: '/pages/wallet/cash/log'
				});
			},
			onLog() {
				uni.navigateTo({
					url: '/pages/wallet/capital/index'
				});
			},
			onWithdrawal() {
				uni.navigateTo({
					url: '/pages/wallet/cash/index'
				});
			}
		}
	};
</script>

<style lang="scss">
	page {
		background-color: #fff;
	}

	.app {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;

		.price {
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;

			.number {
				font-size: 52rpx;
				margin-bottom: 15rpx;
				font-family: Roboto-Medium, Roboto;
				font-weight: bolder;
				color: #ff5200;
			}

			.text {
				font-size: 24rpx;
				color: #c8c9cc;
			}
		}

		.submit {
			width: 70%;
			margin-top: 120rpx;
		}

		.nav {
			display: flex;
			flex-direction: row;

			.item {
				color: #303133;
				margin: 30rpx;
			}
		}
	}
</style>
